﻿<Window x:Class="InfFront.InfoViews.WPF.ProgressDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:InfFront.InfoViews.WPF"
    x:Name="ThisWindow"
    Closing="Window_Closing"
    Title="Running..." Width="300"  Height="170" ResizeMode="NoResize" ShowInTaskbar="False" WindowStartupLocation="CenterOwner">

    <Window.Resources>
        <local:IconedObjectToNormal16x16ImageConverter x:Key="getNormal16x16Image"/>
    </Window.Resources>

    <Window.Icon>
        <Binding Converter="{StaticResource getNormal16x16Image}" />
    </Window.Icon>
    
    <Grid>
        <Grid.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                <GradientStop Offset="0" Color="{Binding Path=VisualSettings.PrimaryBackgroundColor, FallbackValue=Lavender}"/>
                <GradientStop Offset="1" Color="{Binding Path=VisualSettings.SecondaryBackgroundColor, FallbackValue=Azure}"/>
            </LinearGradientBrush>
        </Grid.Background>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0"
                   Text="{Binding ElementName=ThisWindow, Path=MainMessage, FallbackValue='Please wait...'}" Margin="8,8,8,16" />
        
        <DockPanel Grid.Row="1" Name="progressPanel" Visibility="Hidden">
            <TextBlock VerticalAlignment="Bottom" Margin="12,1,10,0"
                       Text="{Binding ElementName=ThisWindow, Path=ProgressMessage}" DockPanel.Dock="Top" />
            <ProgressBar x:Name="progressBar" Margin="10,0,10,1" Maximum="1.0"
                         Value="{Binding ElementName=ThisWindow, Path=Progress}"
                         VerticalAlignment="Bottom" Height="25" />
        </DockPanel>

        <Grid Grid.Row="2" Height="40" VerticalAlignment="Top" Margin="0,8,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Button Name="btnCancel" Grid.Column="1"
                Click="btnCancel_Click" Margin="4" Padding="4,1,4,1">Cancel</Button>
        </Grid>
    </Grid>
</Window>
